#include<bits/stdc++.h>
using namespace std;
const int N=5e3+5; 
long long n,m,l,r;
double ans,ans1;
struct node{
	long long a,b,c;
}a[N];
bool cmp(node i,node j)
{
	return i.b<j.b;
}
bool cmp1(node i,node j)
{
	if(i.c==j.c) return i.a<j.a;
	return i.c<j.c;
}
bool cmp2(node i,node j)
{
	if(i.b-i.a==j.b-j.a) return i.b<j.b;
	return i.b-i.a<j.b-j.a;
}
int main()
{
	freopen("talk.in","r",stdin);
	freopen("talk.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m;
	for(int i=1;i<=n;++i)
	{
		cin>>a[i].a>>a[i].b;
		if(a[i].b==-1)
			a[i].b=1e7;
	}
	ans=1e7;
	for(int i=0;i<=m;++i)
	{
		ans1=0;
		sort(a+1,a+n+1,cmp);
		for(int j=1;j<=i;++j)
			a[j].c=1,ans1+=(double)1.0*a[j].b/j;
		sort(a+1,a+n+1,cmp1);
		for(int j=1;j<=m-i;++j)
			ans1+=1.0*a[j].a/(1.0*i+1);
		ans=min(ans1,ans); 
	}
	for(int i=1;i<=n;++i)
		a[i].c=0;
	for(int i=0;i<=m;++i)
	{
		ans1=0;
		sort(a+1,a+n+1,cmp);
		sort(a+1,a+m+1,cmp2);
		for(int j=1;j<=i;++j)
			a[j].c=1,ans1+=(double)1.0*a[j].b/j;
		sort(a+1,a+n+1,cmp1);
		for(int j=1;j<=m-i;++j)
			ans1+=1.0*a[j].a/(1.0*i+1);
		ans=min(ans1,ans); 
	}
	printf("%.8f",ans); 
	return 0;
 } 
